<?php

class Application_Model_DbTable_ZFGeoLoc extends Zend_Db_Table_Abstract {

    protected $_name = 'zf_ipgeoloc';

    public function getCountryCodeByGeo($geoCountry) {
      #  $geoCountry = "HONG KONG";
        if ($geoCountry == "") {
            return "GB";
        } else {
            $select = $this->_db->select()
                            ->from($this->_name, array('code_country','name'))
                            ->where('name = ?', $geoCountry);
            $resultsa = $this->getAdapter()->fetchAll($select);
            #Zend_Debug::dump($resultsa, '$resultsa', true);
            return $resultsa[0]['code_country'];
        }
    }

}
?>
